package com.example.campusforumapi.dao;

import com.example.campusforumapi.entity.Article;
import com.example.campusforumapi.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {

    /*
     * 查询所有文章分类列表
     * */
    @Select("select * from articlecategory order by category_id")
    List<Category> getCategories();

    /*
     * 返回分页数据列表
     * @param pageUtil
     * @return
     * */
    List<Article> list(Integer articleId, String username, String title, Integer categoryId);

    /*
     * 删除一条或多条文章记录
     * */
    int delArticle(List<Integer> ids);
    /*
     * 添加
     * @paramArticle
     * */
    int insertArticle(Article article);
    /*
     * 修改
     * @paramArticle
     * */
    int updArticle(Article article);

    List<Article> AuditList(Integer articleId);

    int updAproveArticle(Article article);

    int updRejectArticle(Article article);

}
